package com.shhimto.member.client.ui;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Cursor;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiTemplate;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DecoratorPanel;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Widget;

public class MemberTileList extends Composite {
	@UiTemplate("MemberTileList.ui.xml")
	interface MemberTileListUiBinder extends UiBinder<Widget, MemberTileList> {	}
	private static MemberTileListUiBinder uiBinder = GWT.create(MemberTileListUiBinder.class);
	
	private Widget memberTileList ;
	MemberDetailPopUp memberDetails ;
	@UiField DecoratorPanel memberTile ;
	@UiField MemberResources resources ;
	
	public MemberTileList() {
		memberTileList = uiBinder.createAndBindUi(this);
		memberTile.getElement().getStyle().setCursor(Cursor.POINTER);
		memberTile.addDomHandler(clickHandler, ClickEvent.getType()) ;
		memberDetails = new MemberDetailPopUp() ;
		memberDetails.setStyleName(resources.memberCss().noBorder()) ;
	}

	public Widget getMemberTileList(){
		return memberTileList ;
	}
	
	ClickHandler clickHandler = new ClickHandler() {
		
		@Override
		public void onClick(ClickEvent event) {
			
			memberDetails.show();
			
		}
	};
}
